<table border="0" width="100%" cellspacing="3" cellpadding="3">
  <tr>
  
  <?php
  if ($category_depth == 'nested') {
  ?>
  <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="componentheading"><?php echo $a[heading] ?></td>
          </tr>
          <tr>
      <td class="productListing-data" colspan="2"><?php echo $a[categories_description]; ?></td>    
    	</tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
<?php
for($i = 1; $i < $r; $i++) {?>
<td align="center" class="smallText" width="<?php echo $a[colwidth] ?>" valign="top">

<?php echo $a[subcat][$i]; 
	echo $a[subcat_cl][$i]; 
	}
?>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
          </tr>
           <tr>
            <td><?php include(DIR_WS_MODULES . FILENAME_FEATURED_PRODUCTS); ?></td>
          </tr>
          <tr>
            <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  <?php
  } elseif ($category_depth == 'products' || isset($_REQUEST['manufacturers_id'])) {
  ?>

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="componentheading"><?php echo $a[heading] ?></td>
<td align="center" class="componentheading"><?php echo $a[filterform] ?></td>
            
          </tr>
          <tr>
      <td class="productListing-data" colspan="2"><?php echo $a[categories_description]; ?></td>    
    	</tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
    <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2"><tr>
	<?php 
	for($i = 1; $i < $t; $i++) {?>
	<td align="center" class="smallText" style="width: <?php echo $a[colwidth] ?> valign="top">
	<?php echo $a[subcat][$i]; 
	echo $a[subcat_cl][$i]; 
	}
	?>
	</tr></table></td>
	</tr>
	<tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
      <tr>
        <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
      </tr>
    </table></td>
  <?php
  } else {
  ?>
      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="componentheading"><?php echo $a[heading] ?></td>
            
          </tr>
          <tr>
      <td class="productListing-data" colspan="2"><?php echo $a[categories_description]; ?></td>    
    	</tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="main"><?php echo $a[greeting] ?></td>
          </tr>
          <tr>
            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
          </tr>
          <td class="main"><?php echo $a[pagetext] ?></td>
          </tr>
					<tr>
            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>
          </tr>
					<?php if (CATEGORIES_BLOCK=="true") { ?>
          <tr>
            <td><?php include(DIR_WS_MODULES . FILENAME_NEW_CATEGORIES); ?></td>
          </tr>
          <tr>
            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
          </tr><?php } ?>
  <tr>
            <td><?php include(DIR_WS_MODULES . FILENAME_FEATURED_PRODUCTS); ?></td>
          </tr>
          <tr>
            <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
          </tr>
         
           <?PHP
          IF (SHOW_SPECIALS_INDEX == 'true'){
          ?>
          <tr>
            <td><br><?php include(DIR_WS_MODULES . FILENAME_DEFAULT_SPECIALS); ?></td>
          </tr>
          <?PHP
          }
          ?>
<?php
    include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>
        </table></td>
      </tr>
    </table></td>
  <?php
  }
  ?>
  </table>